<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
            "http://www.w3.org/TR/REC-html40/loose.dtd">
<HTML>
<HEAD>



<META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<META name="GENERATOR" content="hevea 1.08">
<LINK rel="stylesheet" type="text/css" href="libman.css">
<TITLE>
Domains and Domain Variables
</TITLE>
</HEAD>
<BODY >
<A HREF="libman032.html"><IMG SRC ="contents_motif.gif" ALT="Up"></A>
<A HREF="libman034.html"><IMG SRC ="next_motif.gif" ALT="Next"></A>
<HR>

<H2 CLASS="section"><A NAME="htoc70">6.1</A>&nbsp;&nbsp;Domains and Domain Variables</H2>

This library uses the
<A HREF="../bips/kernel/termcomp/domain-1.html"><B>domain</B></A><A NAME="@default187"></A>
feature provided by the ECLiPSe kernel. 
This means that domains need to be declared.
The declaration specifies the domain values and their order. For example:
<BLOCKQUOTE CLASS="quote"><PRE CLASS="verbatim">
?- local domain(weekday(mo,tu,we,th,fr,sa,su)).
</PRE></BLOCKQUOTE>
declares a domain with name 'weekday' and values 'mo', 'tu' etc. The
domain values are implicitly ordered, with 'mo' corresponding to 1,
until 'su' corresponding to 7. Domain values must be unique within
one ECLiPSe module, i.e. a symbolic value can belong to at most one
domain.<BR>
<BR>
A variable of a declared domain can then be created using
<BLOCKQUOTE CLASS="quote"><PRE CLASS="verbatim">
?- X &amp;:: weekday.
X = X{[mo, tu, we, th, fr, sa, su]}
Yes (0.00s cpu)
</PRE></BLOCKQUOTE>
or multiple variables using
<BLOCKQUOTE CLASS="quote"><PRE CLASS="verbatim">
?- [X,Y,Z] &amp;:: weekday.
X = X{[mo, tu, we, th, fr, sa, su]}
Y = Y{[mo, tu, we, th, fr, sa, su]}
Z = Z{[mo, tu, we, th, fr, sa, su]}
Yes (0.00s cpu)
</PRE></BLOCKQUOTE>
<HR>
<A HREF="libman032.html"><IMG SRC ="contents_motif.gif" ALT="Up"></A>
<A HREF="libman034.html"><IMG SRC ="next_motif.gif" ALT="Next"></A>
</BODY>
</HTML>
